#ifndef VA_ADB_MSG_MANAGE_H
#define VA_ADB_MSG_MANAGE_H

#include "adb_command_queue.h"
#include "adb_callback.h"
#include "adb_msg_win.h"

#include <list>
#include <queue>

namespace VA
{
    class AdbMsgManage : public AdbMsgManageCallback, public std::enable_shared_from_this<AdbMsgManage>
    {
    public:
        AdbMsgManage(int index = 0);
        ~AdbMsgManage();

    public:
        void clearAll();
        void OnHandleComplete() override;
        void execute(std::shared_ptr<AdbCommandQueue> adb_command_queue);
        template<class T, class U>
        bool compare_shared_ptr(const std::shared_ptr<T>& a, const std::shared_ptr<U>& b)
        {
            if (!a || !b || !a.get() || !b.get()) return false;
            if (a.get() == b.get()) return true;
            return false;
        }
    private:
        int _index;
        std::list<std::shared_ptr<AdbMsgWin>> mAdbMsgWin;
        std::queue<std::shared_ptr<AdbCommandQueue>> mAdbCommandQueue;

    };
}

#endif